#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# @Project : chat_model 
# @File    : session_schema.py
# @IDE     : PyCharm 
# @Author  :ZH
# @Time    : 2025/1/3 17:03
from tortoise import fields

from apps.models.base_model import BaseModel
from apps.utils.enumerate import SessionTypeEnum


class Session(BaseModel):
    __doc__ = "会话配置表"
    session_name = fields.CharField(max_length=256, null=False, description='会话名称')
    description = fields.CharField(max_length=256, null=True, description='描述')
    user_id = fields.IntField(null=False, description='用户id')
    session_type = fields.IntEnumField(SessionTypeEnum, default=SessionTypeEnum.chat, description='会话类型')
    model_id = fields.IntField(null=False, description='模型id')
    prompt = fields.CharField(max_length=1024, null=True, description='提示词')
    network = fields.BooleanField(default=False, description='是否支持网络')

    class Meta:
        table = "session"
        table_description = "会话配置表"
